package com.dt.platform.domain.oa;

import com.github.foxnic.dao.entity.Entity;
import io.swagger.annotations.ApiModel;
import javax.persistence.Table;
import com.github.foxnic.sql.meta.DBTable;
import com.dt.platform.constants.db.OaTables.OA_PROJECT_PHASE;
import javax.persistence.Id;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
import javax.persistence.Transient;
import com.github.foxnic.api.swagger.EnumFor;
import org.github.foxnic.web.domain.system.DictItem;
import org.github.foxnic.web.domain.hrm.Employee;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.github.foxnic.commons.lang.DataParser;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import com.github.foxnic.dao.entity.EntityContext;
import com.dt.platform.domain.oa.meta.ProjectPhaseMeta;
import com.github.foxnic.sql.data.ExprRcd;



/**
 * 项目阶段
 * <p>项目阶段 , 数据表 oa_project_phase 的PO类型</p>
 * @author 金杰 , maillank@qq.com
 * @since 2025-07-01 13:15:34
 * @sign A366F9AAC4E9FD9AB1D3BD386E0BDF85
 * 此文件由工具自动生成，请勿修改。若表结构或配置发生变动，请使用工具重新生成。
*/

@Table(name = "oa_project_phase")
@ApiModel(description = "项目阶段 ; 项目阶段 , 数据表 oa_project_phase 的PO类型")
public class ProjectPhase extends Entity {

	private static final long serialVersionUID = 1L;

	public static final DBTable TABLE =OA_PROJECT_PHASE.$TABLE;
	
	/**
	 * 主键：主键
	*/
	@Id
	@ApiModelProperty(required = true,value="主键" , notes = "主键" , example = "1")
	private String id;
	
	/**
	 * 项目名称：项目名称
	*/
	@ApiModelProperty(required = false,value="项目名称" , notes = "项目名称" , example = "oa_project_phase_tpl")
	private String projectId;
	
	/**
	 * 阶段名称：阶段名称
	*/
	@ApiModelProperty(required = false,value="阶段名称" , notes = "阶段名称" , example = "立项阶段")
	private String name;
	
	/**
	 * 阶段负责人：阶段负责人
	*/
	@ApiModelProperty(required = false,value="阶段负责人" , notes = "阶段负责人")
	private String leaderId;
	
	/**
	 * 阶段说明：阶段说明
	*/
	@ApiModelProperty(required = false,value="阶段说明" , notes = "阶段说明")
	private String ct;
	
	/**
	 * 开始日期：开始日期
	*/
	@ApiModelProperty(required = false,value="开始日期" , notes = "开始日期")
	private Date sdate;
	
	/**
	 * 结束日期：结束日期
	*/
	@ApiModelProperty(required = false,value="结束日期" , notes = "结束日期")
	private Date edate;
	
	/**
	 * 阶段：阶段
	*/
	@ApiModelProperty(required = false,value="阶段" , notes = "阶段" , example = "1")
	private Integer rk;
	
	/**
	 * 阶段模版：阶段模版
	*/
	@ApiModelProperty(required = false,value="阶段模版" , notes = "阶段模版" , example = "tpl1")
	private String tpl;
	
	/**
	 * 启用模版：启用模版
	*/
	@ApiModelProperty(required = false,value="启用模版" , notes = "启用模版" , example = "enable")
	private String tplStatus;
	
	/**
	 * 创建人ID：创建人ID
	*/
	@ApiModelProperty(required = false,value="创建人ID" , notes = "创建人ID")
	private String createBy;
	
	/**
	 * 创建时间：创建时间
	*/
	@ApiModelProperty(required = false,value="创建时间" , notes = "创建时间")
	private Date createTime;
	
	/**
	 * 修改人ID：修改人ID
	*/
	@ApiModelProperty(required = false,value="修改人ID" , notes = "修改人ID")
	private String updateBy;
	
	/**
	 * 修改时间：修改时间
	*/
	@ApiModelProperty(required = false,value="修改时间" , notes = "修改时间")
	private Date updateTime;
	
	/**
	 * 是否已删除：是否已删除
	*/
	@ApiModelProperty(required = true,value="是否已删除" , notes = "是否已删除" , example = "0")
	private Integer deleted;
	@Transient
	@EnumFor("deleted")
	private Boolean deletedBool;
	
	/**
	 * 删除人ID：删除人ID
	*/
	@ApiModelProperty(required = false,value="删除人ID" , notes = "删除人ID")
	private String deleteBy;
	
	/**
	 * 删除时间：删除时间
	*/
	@ApiModelProperty(required = false,value="删除时间" , notes = "删除时间")
	private Date deleteTime;
	
	/**
	 * version：version
	*/
	@ApiModelProperty(required = false,value="version" , notes = "version" , example = "1")
	private Integer version;
	
	/**
	 * phaseTplDict：phaseTplDict
	*/
	@ApiModelProperty(required = false,value="phaseTplDict" , notes = "phaseTplDict")
	private DictItem phaseTplDict;
	
	/**
	 * leader：leader
	*/
	@ApiModelProperty(required = false,value="leader" , notes = "leader")
	private Employee leader;
	
	/**
	 * dateRange：dateRange
	*/
	@ApiModelProperty(required = false,value="dateRange" , notes = "dateRange")
	private String dateRange;
	
	/**
	 * partUserList：partUserList
	*/
	@ApiModelProperty(required = false,value="partUserList" , notes = "partUserList")
	private List<Employee> partUserList;
	
	/**
	 * partUserStrList：partUserStrList
	*/
	@ApiModelProperty(required = false,value="partUserStrList" , notes = "partUserStrList")
	private List<String> partUserStrList;
	
	/**
	 * 获得 主键<br>
	 * 主键
	 * @return 主键
	*/
	public String getId() {
		return id;
	}
	
	/**
	 * 设置 主键
	 * @param id 主键
	 * @return 当前对象
	*/
	public ProjectPhase setId(String id) {
		this.id=id;
		return this;
	}
	
	/**
	 * 获得 项目名称<br>
	 * 项目名称
	 * @return 项目名称
	*/
	public String getProjectId() {
		return projectId;
	}
	
	/**
	 * 设置 项目名称
	 * @param projectId 项目名称
	 * @return 当前对象
	*/
	public ProjectPhase setProjectId(String projectId) {
		this.projectId=projectId;
		return this;
	}
	
	/**
	 * 获得 阶段名称<br>
	 * 阶段名称
	 * @return 阶段名称
	*/
	public String getName() {
		return name;
	}
	
	/**
	 * 设置 阶段名称
	 * @param name 阶段名称
	 * @return 当前对象
	*/
	public ProjectPhase setName(String name) {
		this.name=name;
		return this;
	}
	
	/**
	 * 获得 阶段负责人<br>
	 * 阶段负责人
	 * @return 阶段负责人
	*/
	public String getLeaderId() {
		return leaderId;
	}
	
	/**
	 * 设置 阶段负责人
	 * @param leaderId 阶段负责人
	 * @return 当前对象
	*/
	public ProjectPhase setLeaderId(String leaderId) {
		this.leaderId=leaderId;
		return this;
	}
	
	/**
	 * 获得 阶段说明<br>
	 * 阶段说明
	 * @return 阶段说明
	*/
	public String getCt() {
		return ct;
	}
	
	/**
	 * 设置 阶段说明
	 * @param ct 阶段说明
	 * @return 当前对象
	*/
	public ProjectPhase setCt(String ct) {
		this.ct=ct;
		return this;
	}
	
	/**
	 * 获得 开始日期<br>
	 * 开始日期
	 * @return 开始日期
	*/
	public Date getSdate() {
		return sdate;
	}
	
	/**
	 * 设置 开始日期
	 * @param sdate 开始日期
	 * @return 当前对象
	*/
	public ProjectPhase setSdate(Date sdate) {
		this.sdate=sdate;
		return this;
	}
	
	/**
	 * 获得 结束日期<br>
	 * 结束日期
	 * @return 结束日期
	*/
	public Date getEdate() {
		return edate;
	}
	
	/**
	 * 设置 结束日期
	 * @param edate 结束日期
	 * @return 当前对象
	*/
	public ProjectPhase setEdate(Date edate) {
		this.edate=edate;
		return this;
	}
	
	/**
	 * 获得 阶段<br>
	 * 阶段
	 * @return 阶段
	*/
	public Integer getRk() {
		return rk;
	}
	
	/**
	 * 设置 阶段
	 * @param rk 阶段
	 * @return 当前对象
	*/
	public ProjectPhase setRk(Integer rk) {
		this.rk=rk;
		return this;
	}
	
	/**
	 * 获得 阶段模版<br>
	 * 阶段模版
	 * @return 阶段模版
	*/
	public String getTpl() {
		return tpl;
	}
	
	/**
	 * 设置 阶段模版
	 * @param tpl 阶段模版
	 * @return 当前对象
	*/
	public ProjectPhase setTpl(String tpl) {
		this.tpl=tpl;
		return this;
	}
	
	/**
	 * 获得 启用模版<br>
	 * 启用模版
	 * @return 启用模版
	*/
	public String getTplStatus() {
		return tplStatus;
	}
	
	/**
	 * 设置 启用模版
	 * @param tplStatus 启用模版
	 * @return 当前对象
	*/
	public ProjectPhase setTplStatus(String tplStatus) {
		this.tplStatus=tplStatus;
		return this;
	}
	
	/**
	 * 获得 创建人ID<br>
	 * 创建人ID
	 * @return 创建人ID
	*/
	public String getCreateBy() {
		return createBy;
	}
	
	/**
	 * 设置 创建人ID
	 * @param createBy 创建人ID
	 * @return 当前对象
	*/
	public ProjectPhase setCreateBy(String createBy) {
		this.createBy=createBy;
		return this;
	}
	
	/**
	 * 获得 创建时间<br>
	 * 创建时间
	 * @return 创建时间
	*/
	public Date getCreateTime() {
		return createTime;
	}
	
	/**
	 * 设置 创建时间
	 * @param createTime 创建时间
	 * @return 当前对象
	*/
	public ProjectPhase setCreateTime(Date createTime) {
		this.createTime=createTime;
		return this;
	}
	
	/**
	 * 获得 修改人ID<br>
	 * 修改人ID
	 * @return 修改人ID
	*/
	public String getUpdateBy() {
		return updateBy;
	}
	
	/**
	 * 设置 修改人ID
	 * @param updateBy 修改人ID
	 * @return 当前对象
	*/
	public ProjectPhase setUpdateBy(String updateBy) {
		this.updateBy=updateBy;
		return this;
	}
	
	/**
	 * 获得 修改时间<br>
	 * 修改时间
	 * @return 修改时间
	*/
	public Date getUpdateTime() {
		return updateTime;
	}
	
	/**
	 * 设置 修改时间
	 * @param updateTime 修改时间
	 * @return 当前对象
	*/
	public ProjectPhase setUpdateTime(Date updateTime) {
		this.updateTime=updateTime;
		return this;
	}
	
	/**
	 * 获得 是否已删除<br>
	 * 是否已删除
	 * @return 是否已删除
	*/
	public Integer getDeleted() {
		return deleted;
	}
	
	/**
	 * 获得 是否已删除 的投影属性<br>
	 * 等价于 getDeleted 方法，获得对应的枚举类型
	 * @return 是否已删除
	*/
	@Transient
	public Boolean isDeleted() {
		if(this.deletedBool==null) {
			this.deletedBool=DataParser.parseBoolean(deleted);
		}
		return this.deletedBool ;
	}
	
	/**
	 * 设置 是否已删除
	 * @param deleted 是否已删除
	 * @return 当前对象
	*/
	@JsonProperty("deleted")
	public ProjectPhase setDeleted(Integer deleted) {
		this.deleted=deleted;
		this.deletedBool=DataParser.parseBoolean(deleted);
		return this;
	}
	
	/**
	 * 设置 是否已删除的投影属性，等同于设置 是否已删除
	 * @param deletedBool 是否已删除
	 * @return 当前对象
	*/
	@Transient
	public ProjectPhase setDeleted(Boolean deletedBool) {
		if(deletedBool==null) {
			this.deleted=null;
		} else {
			this.deleted=deletedBool?1:0;
		}
		this.deletedBool=deletedBool;
		return this;
	}
	
	/**
	 * 获得 删除人ID<br>
	 * 删除人ID
	 * @return 删除人ID
	*/
	public String getDeleteBy() {
		return deleteBy;
	}
	
	/**
	 * 设置 删除人ID
	 * @param deleteBy 删除人ID
	 * @return 当前对象
	*/
	public ProjectPhase setDeleteBy(String deleteBy) {
		this.deleteBy=deleteBy;
		return this;
	}
	
	/**
	 * 获得 删除时间<br>
	 * 删除时间
	 * @return 删除时间
	*/
	public Date getDeleteTime() {
		return deleteTime;
	}
	
	/**
	 * 设置 删除时间
	 * @param deleteTime 删除时间
	 * @return 当前对象
	*/
	public ProjectPhase setDeleteTime(Date deleteTime) {
		this.deleteTime=deleteTime;
		return this;
	}
	
	/**
	 * 获得 version<br>
	 * version
	 * @return version
	*/
	public Integer getVersion() {
		return version;
	}
	
	/**
	 * 设置 version
	 * @param version version
	 * @return 当前对象
	*/
	public ProjectPhase setVersion(Integer version) {
		this.version=version;
		return this;
	}
	
	/**
	 * 获得 phaseTplDict<br>
	 * phaseTplDict
	 * @return phaseTplDict
	*/
	public DictItem getPhaseTplDict() {
		return phaseTplDict;
	}
	
	/**
	 * 设置 phaseTplDict
	 * @param phaseTplDict phaseTplDict
	 * @return 当前对象
	*/
	public ProjectPhase setPhaseTplDict(DictItem phaseTplDict) {
		this.phaseTplDict=phaseTplDict;
		return this;
	}
	
	/**
	 * 获得 leader<br>
	 * leader
	 * @return leader
	*/
	public Employee getLeader() {
		return leader;
	}
	
	/**
	 * 设置 leader
	 * @param leader leader
	 * @return 当前对象
	*/
	public ProjectPhase setLeader(Employee leader) {
		this.leader=leader;
		return this;
	}
	
	/**
	 * 获得 dateRange<br>
	 * dateRange
	 * @return dateRange
	*/
	public String getDateRange() {
		return dateRange;
	}
	
	/**
	 * 设置 dateRange
	 * @param dateRange dateRange
	 * @return 当前对象
	*/
	public ProjectPhase setDateRange(String dateRange) {
		this.dateRange=dateRange;
		return this;
	}
	
	/**
	 * 获得 partUserList<br>
	 * partUserList
	 * @return partUserList
	*/
	public List<Employee> getPartUserList() {
		return partUserList;
	}
	
	/**
	 * 设置 partUserList
	 * @param partUserList partUserList
	 * @return 当前对象
	*/
	public ProjectPhase setPartUserList(List<Employee> partUserList) {
		this.partUserList=partUserList;
		return this;
	}
	
	/**
	 * 添加 partUserList
	 * @param partUser partUserList
	 * @return 当前对象
	*/
	public ProjectPhase addPartUser(Employee... partUser) {
		if(this.partUserList==null) {
			partUserList=new ArrayList<>();
		}
		this.partUserList.addAll(Arrays.asList(partUser));
		return this;
	}
	
	/**
	 * 获得 partUserStrList<br>
	 * partUserStrList
	 * @return partUserStrList
	*/
	public List<String> getPartUserStrList() {
		return partUserStrList;
	}
	
	/**
	 * 设置 partUserStrList
	 * @param partUserStrList partUserStrList
	 * @return 当前对象
	*/
	public ProjectPhase setPartUserStrList(List<String> partUserStrList) {
		this.partUserStrList=partUserStrList;
		return this;
	}
	
	/**
	 * 添加 partUserStrList
	 * @param partUserStr partUserStrList
	 * @return 当前对象
	*/
	public ProjectPhase addPartUserStr(String... partUserStr) {
		if(this.partUserStrList==null) {
			partUserStrList=new ArrayList<>();
		}
		this.partUserStrList.addAll(Arrays.asList(partUserStr));
		return this;
	}

	/**
	 * 将自己转换成指定类型的PO
	 * @param poType  PO类型
	 * @return ProjectPhase , 转换好的 ProjectPhase 对象
	*/
	@Transient
	public <T extends Entity> T toPO(Class<T> poType) {
		return EntityContext.create(poType, this);
	}

	/**
	 * 将自己转换成任意指定类型
	 * @param pojoType  Pojo类型
	 * @return ProjectPhase , 转换好的 PoJo 对象
	*/
	@Transient
	public <T> T toPojo(Class<T> pojoType) {
		if(Entity.class.isAssignableFrom(pojoType)) {
			return (T)this.toPO((Class<Entity>)pojoType);
		}
		try {
			T pojo=pojoType.newInstance();
			EntityContext.copyProperties(pojo, this);
			return pojo;
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}

	/**
	 * 克隆当前对象
	*/
	@Transient
	public ProjectPhase clone() {
		return duplicate(true);
	}

	/**
	 * 复制当前对象
	 * @param all 是否复制全部属性，当 false 时，仅复制来自数据表的属性
	*/
	@Transient
	public ProjectPhase duplicate(boolean all) {
		com.dt.platform.domain.oa.meta.ProjectPhaseMeta.$$proxy$$ inst = new com.dt.platform.domain.oa.meta.ProjectPhaseMeta.$$proxy$$();
		inst.setSdate(this.getSdate());
		inst.setUpdateTime(this.getUpdateTime());
		inst.setEdate(this.getEdate());
		inst.setVersion(this.getVersion());
		inst.setLeaderId(this.getLeaderId());
		inst.setCt(this.getCt());
		inst.setTpl(this.getTpl());
		inst.setCreateBy(this.getCreateBy());
		inst.setDeleted(this.getDeleted());
		inst.setCreateTime(this.getCreateTime());
		inst.setUpdateBy(this.getUpdateBy());
		inst.setDeleteTime(this.getDeleteTime());
		inst.setName(this.getName());
		inst.setRk(this.getRk());
		inst.setDeleteBy(this.getDeleteBy());
		inst.setId(this.getId());
		inst.setTplStatus(this.getTplStatus());
		inst.setProjectId(this.getProjectId());
		if(all) {
			inst.setLeader(this.getLeader());
			inst.setDateRange(this.getDateRange());
			inst.setPartUserStrList(this.getPartUserStrList());
			inst.setPartUserList(this.getPartUserList());
			inst.setPhaseTplDict(this.getPhaseTplDict());
		}
		inst.clearModifies();
		return inst;
	}

	/**
	 * 克隆当前对象
	*/
	@Transient
	public ProjectPhase clone(boolean deep) {
		return EntityContext.clone(ProjectPhase.class,this,deep);
	}

	/**
	 * 将 Map 转换成 ProjectPhase
	 * @param projectPhaseMap 包含实体信息的 Map 对象
	 * @return ProjectPhase , 转换好的的 ProjectPhase 对象
	*/
	@Transient
	public static ProjectPhase createFrom(Map<String,Object> projectPhaseMap) {
		if(projectPhaseMap==null) return null;
		ProjectPhase po = create();
		EntityContext.copyProperties(po,projectPhaseMap);
		po.clearModifies();
		return po;
	}

	/**
	 * 将 Pojo 转换成 ProjectPhase
	 * @param pojo 包含实体信息的 Pojo 对象
	 * @return ProjectPhase , 转换好的的 ProjectPhase 对象
	*/
	@Transient
	public static ProjectPhase createFrom(Object pojo) {
		if(pojo==null) return null;
		ProjectPhase po = create();
		EntityContext.copyProperties(po,pojo);
		po.clearModifies();
		return po;
	}

	/**
	 * 创建一个 ProjectPhase，等同于 new
	 * @return ProjectPhase 对象
	*/
	@Transient
	public static ProjectPhase create() {
		return new com.dt.platform.domain.oa.meta.ProjectPhaseMeta.$$proxy$$();
	}

	/**
	 * 从 Map 读取
	 * @param map 记录数据
	 * @param cast 是否用 DataParser 进行类型转换
	 * @return  是否读取成功
	*/
	public boolean read(Map<String, Object> map,boolean cast) {
		if(map==null) return false;
		if(cast) {
			this.setSdate(DataParser.parse(Date.class, map.get(ProjectPhaseMeta.SDATE)));
			this.setUpdateTime(DataParser.parse(Date.class, map.get(ProjectPhaseMeta.UPDATE_TIME)));
			this.setEdate(DataParser.parse(Date.class, map.get(ProjectPhaseMeta.EDATE)));
			this.setVersion(DataParser.parse(Integer.class, map.get(ProjectPhaseMeta.VERSION)));
			this.setLeaderId(DataParser.parse(String.class, map.get(ProjectPhaseMeta.LEADER_ID)));
			this.setCt(DataParser.parse(String.class, map.get(ProjectPhaseMeta.CT)));
			this.setTpl(DataParser.parse(String.class, map.get(ProjectPhaseMeta.TPL)));
			this.setCreateBy(DataParser.parse(String.class, map.get(ProjectPhaseMeta.CREATE_BY)));
			this.setDeleted(DataParser.parse(Integer.class, map.get(ProjectPhaseMeta.DELETED)));
			this.setCreateTime(DataParser.parse(Date.class, map.get(ProjectPhaseMeta.CREATE_TIME)));
			this.setUpdateBy(DataParser.parse(String.class, map.get(ProjectPhaseMeta.UPDATE_BY)));
			this.setDeleteTime(DataParser.parse(Date.class, map.get(ProjectPhaseMeta.DELETE_TIME)));
			this.setName(DataParser.parse(String.class, map.get(ProjectPhaseMeta.NAME)));
			this.setRk(DataParser.parse(Integer.class, map.get(ProjectPhaseMeta.RK)));
			this.setDeleteBy(DataParser.parse(String.class, map.get(ProjectPhaseMeta.DELETE_BY)));
			this.setId(DataParser.parse(String.class, map.get(ProjectPhaseMeta.ID)));
			this.setTplStatus(DataParser.parse(String.class, map.get(ProjectPhaseMeta.TPL_STATUS)));
			this.setProjectId(DataParser.parse(String.class, map.get(ProjectPhaseMeta.PROJECT_ID)));
			// others
			this.setLeader(DataParser.parse(Employee.class, map.get(ProjectPhaseMeta.LEADER)));
			this.setDateRange(DataParser.parse(String.class, map.get(ProjectPhaseMeta.DATE_RANGE)));
			this.setPhaseTplDict(DataParser.parse(DictItem.class, map.get(ProjectPhaseMeta.PHASE_TPL_DICT)));
			return true;
		} else {
			try {
				this.setSdate( (Date)map.get(ProjectPhaseMeta.SDATE));
				this.setUpdateTime( (Date)map.get(ProjectPhaseMeta.UPDATE_TIME));
				this.setEdate( (Date)map.get(ProjectPhaseMeta.EDATE));
				this.setVersion( (Integer)map.get(ProjectPhaseMeta.VERSION));
				this.setLeaderId( (String)map.get(ProjectPhaseMeta.LEADER_ID));
				this.setCt( (String)map.get(ProjectPhaseMeta.CT));
				this.setTpl( (String)map.get(ProjectPhaseMeta.TPL));
				this.setCreateBy( (String)map.get(ProjectPhaseMeta.CREATE_BY));
				this.setDeleted( (Integer)map.get(ProjectPhaseMeta.DELETED));
				this.setCreateTime( (Date)map.get(ProjectPhaseMeta.CREATE_TIME));
				this.setUpdateBy( (String)map.get(ProjectPhaseMeta.UPDATE_BY));
				this.setDeleteTime( (Date)map.get(ProjectPhaseMeta.DELETE_TIME));
				this.setName( (String)map.get(ProjectPhaseMeta.NAME));
				this.setRk( (Integer)map.get(ProjectPhaseMeta.RK));
				this.setDeleteBy( (String)map.get(ProjectPhaseMeta.DELETE_BY));
				this.setId( (String)map.get(ProjectPhaseMeta.ID));
				this.setTplStatus( (String)map.get(ProjectPhaseMeta.TPL_STATUS));
				this.setProjectId( (String)map.get(ProjectPhaseMeta.PROJECT_ID));
				// others
				this.setLeader( (Employee)map.get(ProjectPhaseMeta.LEADER));
				this.setDateRange( (String)map.get(ProjectPhaseMeta.DATE_RANGE));
				this.setPhaseTplDict( (DictItem)map.get(ProjectPhaseMeta.PHASE_TPL_DICT));
				return true;
			} catch (Exception e) {
				return false;
			}
		}
	}

	/**
	 * 从 Map 读取
	 * @param r 记录数据
	 * @param cast 是否用 DataParser 进行类型转换
	 * @return  是否读取成功
	*/
	public boolean read(ExprRcd r,boolean cast) {
		if(r==null) return false;
		if(cast) {
			this.setSdate(DataParser.parse(Date.class, r.getValue(ProjectPhaseMeta.SDATE)));
			this.setUpdateTime(DataParser.parse(Date.class, r.getValue(ProjectPhaseMeta.UPDATE_TIME)));
			this.setEdate(DataParser.parse(Date.class, r.getValue(ProjectPhaseMeta.EDATE)));
			this.setVersion(DataParser.parse(Integer.class, r.getValue(ProjectPhaseMeta.VERSION)));
			this.setLeaderId(DataParser.parse(String.class, r.getValue(ProjectPhaseMeta.LEADER_ID)));
			this.setCt(DataParser.parse(String.class, r.getValue(ProjectPhaseMeta.CT)));
			this.setTpl(DataParser.parse(String.class, r.getValue(ProjectPhaseMeta.TPL)));
			this.setCreateBy(DataParser.parse(String.class, r.getValue(ProjectPhaseMeta.CREATE_BY)));
			this.setDeleted(DataParser.parse(Integer.class, r.getValue(ProjectPhaseMeta.DELETED)));
			this.setCreateTime(DataParser.parse(Date.class, r.getValue(ProjectPhaseMeta.CREATE_TIME)));
			this.setUpdateBy(DataParser.parse(String.class, r.getValue(ProjectPhaseMeta.UPDATE_BY)));
			this.setDeleteTime(DataParser.parse(Date.class, r.getValue(ProjectPhaseMeta.DELETE_TIME)));
			this.setName(DataParser.parse(String.class, r.getValue(ProjectPhaseMeta.NAME)));
			this.setRk(DataParser.parse(Integer.class, r.getValue(ProjectPhaseMeta.RK)));
			this.setDeleteBy(DataParser.parse(String.class, r.getValue(ProjectPhaseMeta.DELETE_BY)));
			this.setId(DataParser.parse(String.class, r.getValue(ProjectPhaseMeta.ID)));
			this.setTplStatus(DataParser.parse(String.class, r.getValue(ProjectPhaseMeta.TPL_STATUS)));
			this.setProjectId(DataParser.parse(String.class, r.getValue(ProjectPhaseMeta.PROJECT_ID)));
			return true;
		} else {
			try {
				this.setSdate( (Date)r.getValue(ProjectPhaseMeta.SDATE));
				this.setUpdateTime( (Date)r.getValue(ProjectPhaseMeta.UPDATE_TIME));
				this.setEdate( (Date)r.getValue(ProjectPhaseMeta.EDATE));
				this.setVersion( (Integer)r.getValue(ProjectPhaseMeta.VERSION));
				this.setLeaderId( (String)r.getValue(ProjectPhaseMeta.LEADER_ID));
				this.setCt( (String)r.getValue(ProjectPhaseMeta.CT));
				this.setTpl( (String)r.getValue(ProjectPhaseMeta.TPL));
				this.setCreateBy( (String)r.getValue(ProjectPhaseMeta.CREATE_BY));
				this.setDeleted( (Integer)r.getValue(ProjectPhaseMeta.DELETED));
				this.setCreateTime( (Date)r.getValue(ProjectPhaseMeta.CREATE_TIME));
				this.setUpdateBy( (String)r.getValue(ProjectPhaseMeta.UPDATE_BY));
				this.setDeleteTime( (Date)r.getValue(ProjectPhaseMeta.DELETE_TIME));
				this.setName( (String)r.getValue(ProjectPhaseMeta.NAME));
				this.setRk( (Integer)r.getValue(ProjectPhaseMeta.RK));
				this.setDeleteBy( (String)r.getValue(ProjectPhaseMeta.DELETE_BY));
				this.setId( (String)r.getValue(ProjectPhaseMeta.ID));
				this.setTplStatus( (String)r.getValue(ProjectPhaseMeta.TPL_STATUS));
				this.setProjectId( (String)r.getValue(ProjectPhaseMeta.PROJECT_ID));
				return true;
			} catch (Exception e) {
				return false;
			}
		}
	}
}